#ifndef ROOM_H
#define ROOM_H
#define ROOM_NAME_MAX 80
#define PERSON_NAME_MAX 80
#include <stdlib.h>
struct person{
	int fd;		//socket discripter
	char name[PERSON_NAME_MAX+1]; //plus '\0'
	struct room *curRoom;
};
struct personList{
	struct person *person;
	struct personList *next;
};

struct room{
	unsigned int roomID;
	char name[ROOM_NAME_MAX+1];
	struct personList* list;
	struct room *next;
};

struct room lobby;
struct room *roomList;
void roomInit(void);
struct person *joinNewPerson(int fd, const char *name);
int enterRoomPerson(struct room *room, struct person *person);
struct room *makeNewRoom(struct person *person, const char *name);
void deleteRoom(struct room *room);
void exitPerson(struct person *person);

struct room *findRoom(unsigned int roomID);
struct person *findPerson(int fd);

#endif
